Skip to content

Conversation

jannfis
Copy link
Collaborator

@jannfis jannfis commented Sep 17, 2025

What does this PR do / why we need it:

The AppProject and Repository Credentials management of both agent and principal do not set the namespace properly. Thus, syncing those resources works only when principal and agent are running in the same namespace (i.e. "argocd" or similar).

This PR sets the namespace explicitly to the principal's or agent's namespace before trying to create/update/delete said resources.

Which issue(s) this PR fixes:

Fixes #570

How to test changes / Special notes to the reviewer:

Checklist

  • Documentation update is required by this PR (and has been updated) OR no documentation update is required.

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.62%. Comparing base (a2a7a63) to head (0805ec9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #571      +/-   ##
==========================================
+ Coverage   44.52%   44.62%   +0.10%     
==========================================
  Files          90       90              
  Lines       11909    11926      +17     
==========================================
+ Hits         5302     5322      +20     
+ Misses       6174     6170       -4     
- Partials      433      434       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Should we also update the namespace before comparing the source UID? Otherwise it may try to fetch the resource from the agent's namespace.

exists, sourceUIDMatch, err := a.projectManager.CompareSourceUID(a.context, incomingAppProject)

exists, sourceUIDMatch, err = a.repoManager.CompareSourceUID(a.context, incomingRepo)

Copy link
Collaborator

@chetan-rns chetan-rns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Added a small question. Everything else looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AppProject namespace not updated by Agent
3 participants